﻿namespace csharpcl
{
    public class GPUEnvironment
    {
        public static GPUPlatform[] Platforms { get; private set; }

        public static void Init()
        {
            var pids = Introp.GetPlatformIds();
            if (pids == null || pids.Length == 0)
                Platforms = new GPUPlatform[0];
            else
            {
                Platforms = new GPUPlatform[pids.Length];
                for (int i = 0; i < pids.Length; i++)
                {
                    Platforms[i] = new GPUPlatform(pids[i]);
                    Platforms[i].Init();
                }
            }
        }
    }
}